<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="/c.tld" %>

<html>
<head>
    <title>DSE ALERT!</title>
    <link href="<c:url value='/css/common.css'/>" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>

</head>

<body>
<div id="container">
    <%@ include file="/header.jsp" %>

    <div style="padding:5px">
        <div>
            Welcome to <b>DSE ALERT!</b>
        </div>

        <br/>
        <br/>

        <div>
            <div style="font-size:14pt">New here?</div>
            If you want to use this service,
            please enter your gmail address and hit the 'Submit' button.
        </div>
        <form method="post" onsubmit="return validate();">
            Your Gmail address:
            <input type="text"
                   name="gmailAddress" id="gmailAddress"
                   value="${userEmail}"
                   maxlength="50" size="20">

            <input type="submit" name="submitButton" value="Submit">
        </form>

        <br/>
        <br/>

        <div>
            Please click <a href="<c:url value='/stock/latestPrice'/>" style="font-size:14pt">here</a>,
            if your request has already been accepted by the admin.
        </div>

<%--
        <div style="">
            <div class="floatLeft">
                <p>
                    Add <span style="font-weight:bold;font-style:italic;background-color:lightyellow;">dse-alert@appspot.com</span>
                    to your XMPP client (<i>eg: Google Chat </i>), to receive the current price list as a reply.
                    <br/>
                    - Just send one or more Company Codes (comma/space separated) as a chat message.
                </p>
                <div class="floatLeft">
                    <img src="/images/chat.jpg">
                </div>
            </div>
        </div>
--%>

    </div>

    <%@ include file="/footer.jsp" %>
</div>

<script type="text/javascript">
    function validate() {
        var email = "" + $('#gmailAddress').attr('value');
        if (email.indexOf("@gmail.com") != -1) {
            return true;
        } else {
            alert("<your_gmail_id>@gmail.com");
            return false;
        }
    }
</script>
</body>
</html>